package com.zhl.test.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class DemoController {

	@RequestMapping("/hello")
	public ModelAndView hello() {
		System.out.println("请求到hello");
		ModelAndView modelAndView = new ModelAndView();
		//指定页面
		//如果前面配置了前缀和后缀，这里就不用写成hello.jsp了
		modelAndView.setViewName("hello");
		return modelAndView;
	}

}